
/**
 * 默认弹窗
 * @param {string} content 弹窗内容 
 */
export function showModal(content) {
  wx.showModal({
    content: content,
    showCancel: false,
    confirmText: "关闭",
    confirmColor: "#2979FF"
  })
}

/**
 * 同步弹窗
 */
export function showModalAsync(content) {
  return new Promise((resolve, reject)=> {
    wx.showModal({
      content: content,
      showCancel: false,
      confirmText: "关闭",
      confirmColor: "#2979FF",
      success() {
        resolve()
      },
      fail() {
        reject()
      }
    })
  })
}

/**
 * 同步弹窗含取消
 */
export function showModalCancelAsync(content) {
  return new Promise((resolve, reject)=> {
    wx.showModal({
      content: content,
      confirmText: "确认",
      confirmColor: "#2979FF",
      success(res) {
        resolve(res)
      },
      fail() {
        reject()
      }
    })
  })
}